package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AutoReceiveConfigMapper;
import com.ruoyi.system.domain.AutoReceiveConfig;
import com.ruoyi.system.service.IAutoReceiveConfigService;

/**
 * 订单自动收货配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-22
 */
@Service
public class AutoReceiveConfigServiceImpl implements IAutoReceiveConfigService 
{
    @Autowired
    private AutoReceiveConfigMapper autoReceiveConfigMapper;

    /**
     * 查询订单自动收货配置
     * 
     * @param id 订单自动收货配置主键
     * @return 订单自动收货配置
     */
    @Override
    public AutoReceiveConfig selectAutoReceiveConfigById(Long id)
    {
        return autoReceiveConfigMapper.selectAutoReceiveConfigById(id);
    }

    /**
     * 查询订单自动收货配置列表
     * 
     * @param autoReceiveConfig 订单自动收货配置
     * @return 订单自动收货配置
     */
    @Override
    public List<AutoReceiveConfig> selectAutoReceiveConfigList(AutoReceiveConfig autoReceiveConfig)
    {
        return autoReceiveConfigMapper.selectAutoReceiveConfigList(autoReceiveConfig);
    }

    /**
     * 新增订单自动收货配置
     * 
     * @param autoReceiveConfig 订单自动收货配置
     * @return 结果
     */
    @Override
    public int insertAutoReceiveConfig(AutoReceiveConfig autoReceiveConfig)
    {
        autoReceiveConfig.setCreateTime(DateUtils.getNowDate());
        return autoReceiveConfigMapper.insertAutoReceiveConfig(autoReceiveConfig);
    }

    /**
     * 修改订单自动收货配置
     * 
     * @param autoReceiveConfig 订单自动收货配置
     * @return 结果
     */
    @Override
    public int updateAutoReceiveConfig(AutoReceiveConfig autoReceiveConfig)
    {
        autoReceiveConfig.setUpdateTime(DateUtils.getNowDate());
        return autoReceiveConfigMapper.updateAutoReceiveConfig(autoReceiveConfig);
    }

    /**
     * 批量删除订单自动收货配置
     * 
     * @param ids 需要删除的订单自动收货配置主键
     * @return 结果
     */
    @Override
    public int deleteAutoReceiveConfigByIds(Long[] ids)
    {
        return autoReceiveConfigMapper.deleteAutoReceiveConfigByIds(ids);
    }

    /**
     * 删除订单自动收货配置信息
     * 
     * @param id 订单自动收货配置主键
     * @return 结果
     */
    @Override
    public int deleteAutoReceiveConfigById(Long id)
    {
        return autoReceiveConfigMapper.deleteAutoReceiveConfigById(id);
    }
}
